<html>
    <head>
        <title>修改</title>
    </head>
    <body>
    <center>
        <?php
        //1.导入配置文件
        require("dbconn.php");
        //3.获取要修改信息的id号，拼装查看sql语句，获取要修改的信息
        $id = $_GET['id'];
        $sql = "select * from liuyan where id={$id}";
        echo $sql;
        $result = $mysqli->query($sql); //执行操作
        //var_dump($result);
        $row = $result->fetch_assoc();
        if($row){
        //4、判断是否获取到了要修改的信息
        ?>


                <form action="action.php?action=update" method="post">
                    <table width="320" border="0">
                        <tr>
                            <td align="right">姓名:</td>
                            <td><input type="text" name="name"value="<?php echo $row['name']; ?>"/></td>
                        </tr>
                        <tr>
                            <td align="right">电话:</td>
                            <td><input type="text" name="tel" value="<?php echo $row['tel']; ?>"/></td>
                        </tr>
                        <tr>
                            <td align="right">邮箱:</td>
                            <td><input type="text" name="email" value="<?php echo $row['email'];?>" /></td>
                        </tr>
                        <tr>
                            <td align="right" valign="top">留言:</td>
                            <td><textarea cols="25" rows="5" name="content"><?php echo $row['content'];?></textarea></td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <input type="submit" value="添加"/>&nbsp;&nbsp;
                                <input type="reset" value="重置"/>
                            </td>
                        </tr>
                    </table>
                </form>
        <?php }else{
            echo '没有数据';
        }?>
        </center>
    </body>
</html>